package cn.webrx;


public class Student {
    static {
        System.out.println("static 0");
        System.out.println("static 0");
        System.out.println("static 0");
    }

    private Teacher teacher = new Teacher("李老师");

    public static int pf(int i) {
        return i * i;
    }

    private int id;
    private String name;

    public String getName() {
        return this.name;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Student(int id, String name) {
        this.id = id;
        this.name = name;
        System.out.println("Student(int id,String name)");
    }

    public Student() {
        System.out.println("Student()...");
    }

    {
        System.out.println("初始化1");
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    static {
        System.out.println("static 1");
    }

    {
        System.out.println("初始化2");
    }
}
